package com.heer.api.ResponseData;

import com.heer.api.constants.ReturnCode;

/**
 * Created by heer on 15/10/30.
 */
public class ApiResponse<T> {

    private String msg;
    private T data;
    private int code;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isSccessful() {
        if (getCode() == ReturnCode.SUCCESS)
            return true;
        return false;
    }


    public boolean isTokenExpire() {
        if (getCode() == ReturnCode.LOGIN)
            return true;
        return false;
    }
}

